import StarterKit from '@tiptap/starter-kit'
// 以下注释的扩展已经在 StarterKit 中
// import Document from '@tiptap/extension-document'
// import Paragraph from '@tiptap/extension-paragraph'
// import Text from '@tiptap/extension-text'
// import Heading from '@tiptap/extension-heading'
// import Strike from '@tiptap/extension-strike'

import Bold from '@tiptap/extension-bold'
import CustomNode from '../extension/CustomNode'
import CustomExtension from '../extension/CustomExtension'
import CustomMark from '../extension/CustomMark'

const CustomBold = Bold.extend({
  renderHTML({ HTMLAttributes }) {
    return ['b', HTMLAttributes, 0]
  },
  addKeyboardShortcuts() {
    return {
      'Mod-b': () => this.editor.commands.toggleBold(),
    } 
  }
})

export default [
  StarterKit.configure({
    bold: false,
    heading: {
      levels: [1, 2, 3, 4],
      HTMLAttributes: {
        class: 'head', 
      }
    },
  }),
  CustomBold,
  CustomNode,
  CustomExtension,
  CustomMark
]